<!--
 * @Author: humengchuan 531537052@qq.com
 * @Date: 2024-12-27 15:38:42
 * @LastEditors: humengchuan 531537052@qq.com
 * @LastEditTime: 2024-12-28 14:29:12
 * @FilePath: \project-my\electron-app\src\renderer\src\App.vue
 * @Description: 
-->
<script setup lang="ts">
import Versions from './components/Versions.vue'
import AddFile from './views/addfile/add.vue'
import  MainPage from './views/index/page.vue'
import { onMounted, ref } from 'vue'

const messageText = ref('')
const ipcHandle = () => window.electron.ipcRenderer.send('ping')
console.log('2333', window)
onMounted(() => {
  window.electron.ipcRenderer.send('message', 'hello world1111111111')
  window.electron.ipcRenderer.on('message', (event, message) => {
    console.log('message', message)
    messageText.value = message
  })
})
// window.addEventListener('DOMContentLoaded', () => {
  
// })
</script>

<template>
  <!-- <img alt="logo" class="logo" src="./assets/electron.svg" /> -->
   
  
    <div class="creator">hello world --- {{ messageText }}</div>
  
  <div class="text">
    Build an Electron app with
    <span class="vue">Vue</span>
    and
    <span class="ts">TypeScript</span>
  </div>
  <MainPage />
  <AddFile />
  <!-- <p class="tip">Please try pressing <code>F12</code> to open the devTool</p>
  <div class="actions">
    <div class="action">
      <a href="https://electron-vite.org/" target="_blank" rel="noreferrer">Documentation</a>
    </div>
    <div class="action">
      <a target="_blank" rel="noreferrer" @click="ipcHandle">Send IPC</a>
    </div>
  </div> -->
  <Versions />
</template>
<style lang="scss" scoped>
.creator{
  color: #000000;
}
</style>
